﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using WebNavigationApi.Models;
using WebNavigationApi.Utils;

namespace WebNavigationApi.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class ImageController : Controller
    {
        [HttpGet]
        [Route("GetRandomImg")]
        public IActionResult GetRandomImg()
        {
            var url = "https://api.ixiaowai.cn/gqapi/gqapi.php";
            var image = ImageHelper.UrlToImage(url);
            var result = ImageHelper.ImageConvertBase64StringForJs(image);
            return Ok(new Result(true, 200, "", result));
        }
    }
}
